// 现场检查页面 api
import request from '@/utils/request'

// 查询现场检查列表
export function getDataList(query) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord/list',
    method: 'get',
    params: query,
  })
}

// 保存接口
export function onSiteInspectionSave(query) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord',
    method: 'post',
    data: query,
  })
}

// 修改接口
export function onSiteInspectionUpdate(query) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord',
    method: 'put',
    data: query,
  })
}

// 详情接口
export function onSiteInspectionDetail(id) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord/' + id,
    method: 'get',
  })
}

// 删除接口
export function onSiteInspectionDel(ids) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord/' + ids,
    method: 'DELETE',
  })
}

// 上传附件
export function onSiteInspectionUpload(data) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord/addFiles',
    method: 'post',
    data,
  })
}

// 导出现场检查文书
export function onSiteInspectionExport(data) {
  return request({
    url: '/ruoyi-system/siteinspectionrecord/export',
    method: 'post',
    responseType: 'blob',
    data,
  })
}
